<?php

class Involved_UserLockModel extends BaseModel
{

    protected $table = 'user_lock';

    /**
     * 查询是否被锁
     * @return mixed
     */
    public function LockUser($id)
    {
        return DB::table($this->table)
            ->select('lock_id','user_id','number','ip','lock_time')
            ->where(['user_id'=>$id,'number'=>0])
            ->first();
    }

    /**
     * 查询是否被锁
     * @return mixed
     */
    public function LockUsercishu($id)
    {
        return DB::table($this->table)
            ->select('lock_id','user_id','number','ip','lock_time')
            ->where(['user_id'=>$id])
            ->where('number','>',0)
            ->first();
    }

    /**
     * 查询锁定数据
     * @return mixed
     */
    public function LockUserfirst($id)
    {
        return DB::table($this->table)
            ->select('lock_id','user_id','number','ip','lock_time')
            ->where('user_id',$id)
            ->first();
    }

}
